<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0-0-0" />
<title>车辆使用记录</title>
<link rel='stylesheet' type='text/css' href='${ctx}/scripts/fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='${ctx}/scripts/fullcalendar/fullcalendar.print.css' media='print' />
<script type='text/javascript' src='${ctx}/scripts/fullcalendar/fullcalendar.js'></script>

<script>
		$(document).ready(function() {
		 $("#startDate").addClass("Wate").bind("click", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'1900-10-01',maxDate:'#F{$dp.$D(\'finishDate\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd'});});
		 $("#finishDate").addClass("Wate").bind("click", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'#F{$dp.$D(\'startDate\')}',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'});});
		});
		
	</script>
	<script type='text/javascript'>

$(document).ready(function() {
    	var licenseplateNumber = "${param['filter_LIKES_carInformation.licenseplateNumber']}";
    	var s = encodeURIComponent(licenseplateNumber);
    	var filter_LIKES_department = "${param['filter_LIKES_department']}";
    	var b = encodeURIComponent(filter_LIKES_department);
        $('#calendar').fullCalendar({
        	 height: 200,
        header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            editable: true,
            
            events:
            	"${ctx}/asset/car/record!getSelectListToJson.action?"
            	+"filter_LIKES_carInformation.licenseplateNumber="+s
            	+"&filter_LIKES_department="+b
            	+"&filter_GED_startDate=${param['filter_GED_startDate']}"
            	+"&filter_LED_finishDate=${param['filter_LED_finishDate']}"
        });
    });

</script>
<style type='text/css'>


	#calendar {
		margin: 0 1em 1em 1em;
		}

</style>
</head> 
<body>
<div id="heading" class="car">车辆使用记录</div>
<div id='calendar'></div>
<div id="message"><s:actionmessage theme="custom" cssClass="success"/></div>
<form id="mainForm" action="${ctx }/asset/car/record.action" class="yform" >
<div id="filter">
<ul>
	<li>车牌号:<input type="text" name="filter_LIKES_carInformation.licenseplateNumber" value="${param['filter_LIKES_carInformation.licenseplateNumber']}"/></li>
	<li>开始时间:<input type="text" id="startDate" name="filter_GED_startDate"  value="${param['filter_GED_startDate']}"/></li>
	<li>结束时间:<input type="text" id="finishDate" name="filter_LED_finishDate"  value="${param['filter_LED_finishDate']}"/></li>
</ul>
<div class="type-button"><input type="button" onclick="search();" class="search" value="查询"/>
</div>
  		
  		</div>
  		<div id="content">
  			<table id="contentTable">
  				<tr>
  					<th><a id="createDate" href="javascript:sort('createDate','asc')">序号</a></th>
					<th><a id="carInformation.licenseplateNumber" href="javascript:sort('carInformation.licenseplateNumber','asc')">车牌号</a></th>
  					<th><a id="startDate" href="javascript:sort('startDate','asc')">开始时间</a></th>
  					<th><a id="finishDate" href="javascript:sort('finishDate','asc')">结束时间</a></th>
  					<th>操作	</th>
  				</tr>
  				<c:forEach items="${page.result}" var="carRe" varStatus="status">
  				<tr class="${(status.count % 2 == 0) ? 'even' : 'odd'}">
  					<td>${page.first+status.index }</td>
  					<td>${carRe.carInformation.licenseplateNumber}</td>
  					<td>${carRe.startDate}</td>
  					<td>${carRe.finishDate}</td>
  					<td><a href="${ctx}/asset/car/record!input.action?id=${carRe.id}">编辑</a>
  					<a href="${ctx}/asset/car/record!delete.action?id=${carRe.id}" onclick="return confirmDelete();">删除</a>
  					 </td>
  				</tr>
  				</c:forEach>
  			</table>
  		</div>
<jsp:include page="/common/page.jsp" />
		<div class="type-button"><input onclick="location.href='${ctx}/asset/car/record_input.action'"
		 type="button" class="submit" value="新增" /> 
	</div>
  	</form>
  </body>
</html>
